// This code is licensed under New BSD Licence. For details see project page at
// http://code.google.com/p/hrissan-cocoa-helpers/source/checkout

namespace rfc
{
	
	extern const char BASE64_TABLE_FILESYSTEM_COMPATIBLE[];
	extern const char BASE64_TABLE_STANDARD[];
	// Tells encoder to use _- or +/ for last digits. Decoder understands both versions automatically

	int Base64EncodeGetLength( int size );
	int Base64DecodeGetLength( const char * data, int size ); // -1 if not base 64

	void to_base64( char * result, const unsigned char * data, int count, const char * base64_table = BASE64_TABLE_STANDARD);
	bool from_base64( unsigned char * result, const char * str, int count); // false if not base 64

	NSString * to_base64( NSData * data, const char * base64_table = BASE64_TABLE_STANDARD );
	NSData * from_base64( NSString * str );
	
} // namespace rfc

